package reesoft.common.entity;

import java.io.Serializable;
import java.util.Date;

/**
 * 实体基类
 *
 * Created by reesoft on 2017-07-07
 */
public class BaseEntity implements Serializable
{
    // 数据所有者唯一标识，用于多组织数据隔离
    private Long ownerId;

    // 删除标记，0 未删除，1 已删除
    private Integer deleted;

    // 实体创建的时间
    private Date createdTime;

    // 创建者
    private String createdBy;

    // 实体最近的修改时间
    private Date updatedTime;

    // 最近的修改者
    private String updatedBy;

    public static boolean isValidId(Long id)
    {
        return id != null && id != 0;
    }

    public Long getOwnerId()
    {
        return ownerId;
    }

    public void setOwnerId(Long ownerId)
    {
        this.ownerId = ownerId;
    }

    public Integer getDeleted()
    {
        return deleted;
    }

    public void setDeleted(Integer deleted)
    {
        this.deleted = deleted;
    }

    public Date getCreatedTime()
    {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime)
    {
        this.createdTime = createdTime;
    }

    public String getCreatedBy()
    {
        return createdBy;
    }

    public void setCreatedBy(String createdBy)
    {
        this.createdBy = createdBy;
    }

    public Date getUpdatedTime()
    {
        return updatedTime;
    }

    public void setUpdatedTime(Date updatedTime)
    {
        this.updatedTime = updatedTime;
    }

    public String getUpdatedBy()
    {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy)
    {
        this.updatedBy = updatedBy;
    }
}
